package com.source.barcodeMachineRepairAndScrap.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.source.barcodeMachineRepairAndScrap.entity.BarcodeMachineScrap;
import com.source.barcodeMachineRepairAndScrap.mapper.BarcodeMachineScrapMapper;
import com.source.barcodeMachineRepairAndScrap.service.BarcodeMachineScrapService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.source.barcodeMachineRepairAndScrap.vo.BarcodeMachineScrapVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author IceBerg777
 * @since 2021-03-07
 */
@Service
public class BarcodeMachineScrapServiceImpl extends ServiceImpl<BarcodeMachineScrapMapper, BarcodeMachineScrap> implements BarcodeMachineScrapService {

    @Autowired
    BarcodeMachineScrapMapper scrapMapper;

    @Override
    public IPage<BarcodeMachineScrapVO> findAllScrapOnPagination(Page<BarcodeMachineScrapVO> page) {
        return scrapMapper.findAllScrapOnPagination(page);
    }

    @Override
    public IPage<BarcodeMachineScrapVO> findByMultiKeysOnPagination(Page<BarcodeMachineScrapVO> page, String keyWord) {
        return scrapMapper.findByMultiKeysOnPagination(page,"%"+keyWord+"%");
    }

    @Override
    public BarcodeMachineScrap findById(String id) {
        return scrapMapper.findById(id);
    }

    @Override
    public List<BarcodeMachineScrapVO> findAllScrap() {
        return scrapMapper.findAllScrap();
    }
}
